package com.skwyb.form.core;

import com.skwyb.form.constants.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 业务异常
 *
 * @author Administrator
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BusinessException extends RuntimeException {

    private Integer code;

    private String message;

    public BusinessException(ResultCode code) {
        this.code = code.getCode();
        message = code.getMessage();
    }
}

